Extension point directories
In component org.nuxeo.ecm.directory.sql.SQLDirectoryFactory
Documentation
This extension point can be used to register new SQL-based directories. The extension can contain any number of directories declarations of the form:
<directory name="userDirectory">
<schema>vocabulary</schema>
<dataSource>java:/nxsqldirectory</dataSource>
<table>t</table>
<nativeCase>false</nativeCase>
<idField>username</idField>
<passwordField>password</passwordField>
<passwordHashAlgorithm>SSHA</passwordHashAlgorithm>
<autoincrementIdField>false</autoincrementIdField>
<createTablePolicy>on_missing_columns</createTablePolicy>
<dataFile>setup-hsqldb.csv</dataFile>
<dataFileCharacterSeparator>,</dataFileCharacterSeparator>
<querySizeLimit>1000</querySizeLimit>
<init-dependencies>
<dependency>dir1</dependency>
<dependency>dir2</dependency>
</init-dependencies>
<references>
<tableReference dataFile="user2group.csv"
directory="groupDirectory" field="groups"
schema="user2group" sourceColumn="userId"
table="user2group" targetColumn="groupId"/>
</references>
<permissions>
<permission name="Read">
<group>mygroup</group>
<group>mygroup2</group>
<user>Administrator</user>
</permission>
<permission name="Write">
<group>mygroup3</group>
</permission>
</permissions>
</directory>
Here is the description for each field:
- schema - the name of the schema to be used for the directory entries.
- dataSource - the dataSource name, as registered in the application server.
- table - The name of the sql table where the directory data will be stored.
- idField - the id field designs the primary key in the table, used for retrieving entries by id.
- passwordField - the password field.
- passwordHashAlgorithm - the hash used to encode the password written in the database, either empty (default), SSHA or SMD5.
- autoincrementIdField - if this is set true, the SQLDirectory will fill the id field using a generated unique number, otherwise the client has to supply the id.
- dataFile - file from which to populate the table; the first line must contain the column names. This can be a csv, tsv, psv file. But you must take care of the dataFileCharacterSeparator to specify the character separator
- dataFileCharacterSeparator - character that separate each value if more than one character is set, the first one is gotten and other are skipped. The character is by default "," but you can set ";" or tabulation
- createTablePolicy - one of "never", "always" or "on_missing_columns" if this is set to "never", the table will never be created; if set to "always", the table will be created each time the application is started; if set to "on_missing_columns", the table will be created only if the schema declares some fields that are not present in the sql table.
- querySizeLimit - the maximum number of results that the queries on this directory should return; if there are more results than this, an exception will be raised.
- init-dependencies - a list of directories that should be initialized before this one
- nativeCase - false if table and column names should be used exactly as specificed in the configuration and schemas (quoted), true if they should be converted to database-native case (usually uppercase); the default is false for backward-compatibility.
The references tag is used to define relations between directories. (TODO: describe the references types.)
Contribution Descriptors
- Class: org.nuxeo.ecm.directory.sql.SQLDirectoryDescriptor
Existing Contributions
Contributions are presented in the same order as the registration order on this extension point. This order is displayed before the contribution name, in brackets.
-
<extension point="directories" target="org.nuxeo.ecm.directory.sql.SQLDirectoryFactory"> <directory name="execution_type"> <schema>vocabulary</schema> <dataSource>java:/nxsqldirectory</dataSource> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <table>ecp-note-type</table> <idField>id</idField> <autoincrementIdField>false</autoincrementIdField> <dataFile>directories/execution_type.csv</dataFile> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> </extension>
-
<extension point="directories" target="org.nuxeo.ecm.directory.sql.SQLDirectoryFactory"> <directory name="authTokens"> <dataSource>java:/nxsqldirectory</dataSource> <schema>authtoken</schema> <table>auth_tokens</table> <idField>token</idField> <autoincrementIdField>false</autoincrementIdField> <createTablePolicy>on_missing_columns</createTablePolicy> <!-- Set cache to 5 minutes --> <cacheTimeout>300</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> </directory> </extension>
-
<extension point="directories" target="org.nuxeo.ecm.directory.sql.SQLDirectoryFactory"> <directory name="eventTypes"> <schema>vocabulary</schema> <dataSource>java:/nxsqldirectory</dataSource> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <table>eventTypes</table> <idField>id</idField> <autoincrementIdField>false</autoincrementIdField> <dataFile>directories/event-types.csv</dataFile> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> <directory name="eventCategories"> <schema>vocabulary</schema> <dataSource>java:/nxsqldirectory</dataSource> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <table>eventCategories</table> <idField>id</idField> <autoincrementIdField>false</autoincrementIdField> <dataFile>directories/event-categories.csv</dataFile> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> </extension>
-
<extension point="directories" target="org.nuxeo.ecm.directory.sql.SQLDirectoryFactory"> <directory name="certificate"> <schema>cert</schema> <dataSource>java:/nxsqldirectory</dataSource> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <table>certificate</table> <idField>userid</idField> <autoincrementIdField>false</autoincrementIdField> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> </extension>
-
<extension point="directories" target="org.nuxeo.ecm.directory.sql.SQLDirectoryFactory"> <directory name="country"> <schema>xvocabulary</schema> <parentDirectory>continent</parentDirectory> <dataSource>java:/nxsqldirectory</dataSource> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <table>country</table> <idField>id</idField> <autoincrementIdField>false</autoincrementIdField> <dataFile>directories/country.csv</dataFile> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> <directory name="continent"> <schema>vocabulary</schema> <dataSource>java:/nxsqldirectory</dataSource> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <table>continent</table> <idField>id</idField> <autoincrementIdField>false</autoincrementIdField> <dataFile>directories/continent.csv</dataFile> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> <directory name="l10ncoverage"> <schema>l10nxvocabulary</schema> <parentDirectory>l10ncoverage</parentDirectory> <dataSource>java:/nxsqldirectory</dataSource> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <table>l10ncoverage</table> <idField>id</idField> <autoincrementIdField>false</autoincrementIdField> <dataFile>directories/l10ncoverage.csv</dataFile> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> <directory name="subtopic"> <schema>xvocabulary</schema> <parentDirectory>topic</parentDirectory> <dataSource>java:/nxsqldirectory</dataSource> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <table>subtopic</table> <idField>id</idField> <autoincrementIdField>false</autoincrementIdField> <dataFile>directories/subtopic.csv</dataFile> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> <directory name="topic"> <schema>vocabulary</schema> <dataSource>java:/nxsqldirectory</dataSource> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <table>topic</table> <idField>id</idField> <autoincrementIdField>false</autoincrementIdField> <dataFile>directories/topic.csv</dataFile> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> <directory name="l10nsubjects"> <schema>l10nxvocabulary</schema> <parentDirectory>l10nsubjects</parentDirectory> <dataSource>java:/nxsqldirectory</dataSource> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <table>l10nsubjects</table> <idField>id</idField> <autoincrementIdField>false</autoincrementIdField> <dataFile>directories/l10nsubjects.csv</dataFile> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> <directory name="subject"> <schema>vocabulary</schema> <dataSource>java:/nxsqldirectory</dataSource> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <table>subject</table> <idField>id</idField> <autoincrementIdField>false</autoincrementIdField> <dataFile>directories/subject.csv</dataFile> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> <directory name="search_operators"> <schema>vocabulary</schema> <dataSource>java:/nxsqldirectory</dataSource> <table>search_operators</table> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <idField>id</idField> <autoincrementIdField>false</autoincrementIdField> <dataFile>directories/search_operators.csv</dataFile> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> <directory name="documentsLists"> <schema>documentsLists</schema> <dataSource>java:/nxsqldirectory</dataSource> <table>documentsLists</table> <idField>id</idField> <autoincrementIdField>false</autoincrementIdField> <createTablePolicy>on_missing_columns</createTablePolicy> <permissions> <permission name="Write"> <group>Everyone</group> </permission> </permissions> </directory> <directory name="language"> <schema>vocabulary</schema> <dataSource>java:/nxsqldirectory</dataSource> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <table>language</table> <idField>id</idField> <autoincrementIdField>false</autoincrementIdField> <dataFile>directories/language.csv</dataFile> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> <directory name="nature"> <schema>vocabulary</schema> <dataSource>java:/nxsqldirectory</dataSource> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <table>nature</table> <idField>id</idField> <autoincrementIdField>false</autoincrementIdField> <dataFile>directories/nature.csv</dataFile> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> <!-- @since 5.6 --> <directory name="locale"> <schema>vocabulary</schema> <dataSource>java:/nxsqldirectory</dataSource> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <table>locale</table> <idField>id</idField> <autoincrementIdField>false</autoincrementIdField> <dataFile>directories/locale.csv</dataFile> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> </extension>
-
<extension point="directories" target="org.nuxeo.ecm.directory.sql.SQLDirectoryFactory"> <directory name="userDirectory"> <schema>user</schema> <dataSource>jdbc/nxsqldirectory</dataSource> <table>users</table> <idField>username</idField> <passwordField>password</passwordField> <passwordHashAlgorithm>SSHA</passwordHashAlgorithm> <autoincrementIdField>false</autoincrementIdField> <computeMultiTenantId>false</computeMultiTenantId> <dataFile>users.csv</dataFile> <createTablePolicy>on_missing_columns</createTablePolicy> <querySizeLimit>50</querySizeLimit> <!-- comment <cache* /> tags to disable the cache --> <cacheEntryName>sql-user-entry-cache</cacheEntryName> <cacheEntryWithoutReferencesName>sql-user-entry-cache-without-references</cacheEntryWithoutReferencesName> <references> <inverseReference directory="groupDirectory" dualReferenceField="members" field="groups"/> </references> </directory> <directory name="groupDirectory"> <schema>group</schema> <dataSource>jdbc/nxsqldirectory</dataSource> <table>groups</table> <idField>groupname</idField> <dataFile>groups.csv</dataFile> <createTablePolicy>on_missing_columns</createTablePolicy> <autoincrementIdField>false</autoincrementIdField> <!-- comment <cache* /> tags to disable the cache --> <cacheEntryName>sql-group-entry-cache</cacheEntryName> <cacheEntryWithoutReferencesName>sql-group-entry-cache-without-references</cacheEntryWithoutReferencesName> <references> <tableReference dataFile="user2group.csv" directory="userDirectory" field="members" schema="user2group" sourceColumn="groupId" table="user2group" targetColumn="userId"/> <!-- Warning ! From Nuxeo 5.3.1, a wrong setting has been fixed. See http://jira.nuxeo.org/browse/NXP-4401 . Nuxeo upgrades would need a fix in the database (inverting parentGroupId and childGroupId in the group2group) --> <tableReference directory="groupDirectory" field="subGroups" schema="group2group" sourceColumn="parentGroupId" table="group2group" targetColumn="childGroupId"/> <inverseReference directory="groupDirectory" dualReferenceField="subGroups" field="parentGroups"/> </references> </directory> <directory name="digestauth"> <cacheEntryName>sql-digestauth-entry-cache</cacheEntryName> <cacheEntryWithoutReferencesName>sql-digestauth-entry-cache-without-references</cacheEntryWithoutReferencesName> <schema>digestauth</schema> <table>digestauth</table> <autoincrementIdField>false</autoincrementIdField> <dataSource>java:/nxsqldirectory</dataSource> <idField>username</idField> <passwordField>password</passwordField> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> </extension>
-
<extension point="directories" target="org.nuxeo.ecm.directory.sql.SQLDirectoryFactory"> <directory name="oauthConsumers"> <schema>oauthConsumer</schema> <dataSource>java:/nxsqldirectory</dataSource> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <table>oauthConsumers</table> <idField>consumerKey</idField> <autoincrementIdField>false</autoincrementIdField> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> <directory name="oauthServiceProviders"> <schema>oauthServiceProvider</schema> <dataSource>java:/nxsqldirectory</dataSource> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <table>oauthServiceProviders</table> <idField>id</idField> <autoincrementIdField>true</autoincrementIdField> <createTablePolicy>on_missing_columns</createTablePolicy> <substringMatchType>subfinal</substringMatchType> </directory> <directory name="oauthTokens"> <schema>oauthToken</schema> <dataSource>java:/nxsqldirectory</dataSource> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <table>oauthTokens</table> <idField>token</idField> <autoincrementIdField>false</autoincrementIdField> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> <directory name="oauth2ServiceProviders"> <schema>oauth2ServiceProvider</schema> <dataSource>java:/nxsqldirectory</dataSource> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <table>oauth2ServiceProviders</table> <idField>id</idField> <autoincrementIdField>true</autoincrementIdField> <createTablePolicy>on_missing_columns</createTablePolicy> <substringMatchType>subfinal</substringMatchType> </directory> <directory name="oauth2Tokens"> <schema>oauth2Token</schema> <dataSource>java:/nxsqldirectory</dataSource> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <table>oauth2Tokens</table> <idField>id</idField> <autoincrementIdField>true</autoincrementIdField> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> <directory name="oauth2Clients"> <schema>oauth2Client</schema> <dataSource>java:/nxsqldirectory</dataSource> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <table>oauth2Clients</table> <idField>id</idField> <autoincrementIdField>true</autoincrementIdField> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> </extension>
-
<extension point="directories" target="org.nuxeo.ecm.directory.sql.SQLDirectoryFactory"> <directory name="predicates"> <schema>vocabulary</schema> <dataSource>java:/nxsqldirectory</dataSource> <table>relation_predicates</table> <idField>id</idField> <autoincrementIdField>false</autoincrementIdField> <dataFile>directories/relation_predicates.csv</dataFile> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> <directory name="inverse_predicates"> <schema>vocabulary</schema> <dataSource>java:/nxsqldirectory</dataSource> <table>relation_inverse_predicates</table> <idField>id</idField> <autoincrementIdField>false</autoincrementIdField> <dataFile>directories/relation_inverse_predicates.csv</dataFile> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> </extension>
-
<extension point="directories" target="org.nuxeo.ecm.directory.sql.SQLDirectoryFactory"> <directory name="documentationTypes"> <schema>vocabulary</schema> <dataSource>java:/nxsqldirectory</dataSource> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <table>documentationTypes</table> <idField>id</idField> <autoincrementIdField>false</autoincrementIdField> <dataFile>directories/documentation-types.csv</dataFile> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> </extension>
-
<extension point="directories" target="org.nuxeo.ecm.directory.sql.SQLDirectoryFactory"> <directory name="digestauth"> <schema>digestauth</schema> <table>digestauth</table> <autoincrementIdField>false</autoincrementIdField> <dataSource>java:/nxsqldirectory</dataSource> <idField>username</idField> <passwordField>password</passwordField> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> </extension>
-
<extension point="directories" target="org.nuxeo.ecm.directory.sql.SQLDirectoryFactory"> <directory name="shibbGroup"> <schema>shibbolethGroup</schema> <dataSource>java:/nxsqldirectory</dataSource> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <table>shibbGroup</table> <idField>groupName</idField> <autoincrementIdField>false</autoincrementIdField> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> </extension>
-
<extension point="directories" target="org.nuxeo.ecm.directory.sql.SQLDirectoryFactory"> <directory name="aceinfo"> <schema>aceinfo</schema> <dataSource>java:/nxsqldirectory</dataSource> <cacheTimeout>3600</cacheTimeout> <cacheMaxSize>1000</cacheMaxSize> <table>aceinfo</table> <idField>id</idField> <createTablePolicy>on_missing_columns</createTablePolicy> </directory> </extension>